package com.zb_study.writer_;

import java.io.*;

public class BufferedCopy {
    public static void main(String[] args) {

        String srcFilePath = "e:\\story.txt";
        String destFilePath = "e:\\story06.txt";
        BufferedReader br = null;
        BufferedWriter bw = null;
        String line;

        try {
            br = new BufferedReader(new FileReader(srcFilePath));
            bw = new BufferedWriter(new FileWriter(destFilePath));

            while ((line = br.readLine()) !=null) {
                bw.write(line);
                bw.newLine();
            }

            System.out.println("拷贝完毕....");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if(br!=null) {
                    br.close();
                }
                if(bw!=null) {
                    bw.close();
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
